'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
    const { router, controller } = app;
    /** 小程序端api----------------start */
    router.post('/api/login', controller.common.login);
    // 更新用户信息
    router.post('/api/udateUserInfo', controller.common.udateUserInfo);
    // 获取上传token
    router.post('/api/tencentToken', controller.common.getTencentToken);
    // 获取轮播图列表
    router.post('/api/bannerList', controller.bannerList.getBannerList);
    // 获取推荐列表
    router.post('/api/recommendList', controller.touristPlace.getRecommendList);
    // 获取景点详情
    router.post('/api/touristDetail', controller.touristPlace.getPlaceDetail);
    // 保存订单信息
    router.post('/api/createOrder', controller.orderList.createOrder);
    // 获取订单列表
    router.post('/api/orderList', controller.orderList.orderListMini);
    // 删除订单
    router.post('/api/delOrder', controller.orderList.delOrder);

    // 保存行程发布经验
    router.post('/api/strategyAdd', controller.strategyList.strategyAdd);
    router.post('/api/strategyList', controller.strategyList.strategyList);
    /**小程序端api-----------------end */

    /**管理系统端api-------------start */
    router.post('/sys/login', controller.user.login);
    router.get('/sys/bannerList', controller.user.bannerList);
    router.post('/sys/bannerAdd', controller.user.bannerAdd);
    router.post('/sys/bannerEdit', controller.user.bannerEdit);
    router.post('/sys/bannerDel', controller.user.bannerDel);
    router.get('/sys/touristList', controller.user.touristList);
    router.get('/sys/touristDetail', controller.user.touristDetail);
    router.post('/sys/touristAdd', controller.user.touristAdd);
    router.post('/sys/touristEdit', controller.user.touristEdit);
    router.post('/sys/touristDel', controller.user.touristDel);
    router.get('/sys/tencentToken', controller.common.getTencentToken);
    router.get('/sys/userList', controller.common.userList);
    router.get('/sys/orderList', controller.orderList.orderList);
    router.post('/sys/addTravel', controller.user.addTravel);
    router.get('/sys/travelDetail', controller.user.detailTravel);
    router.get('/sys/travelList', controller.user.travelList);
    router.post('/sys/travelDel', controller.user.travelDel);
    /**管理系统端api-------------end */
};